package org.nullauthor.allthings.mods;

import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import org.nullauthor.allthings.Allthings;

public class ModItemGroups {
    public static final RegistryKey<ItemGroup> ALLTHINGS_GROUP = register("allthings_group");

    private static RegistryKey<ItemGroup> register(String id) {
        return RegistryKey.of(RegistryKeys.ITEM_GROUP, new Identifier(Allthings.MOD_ID, id));
    }
    public static void registerGroups() {
        Registry.register(
                Registries.ITEM_GROUP,
                ALLTHINGS_GROUP,
                ItemGroup.create(ItemGroup.Row.TOP, 7)
                        .displayName(Text.translatable("itemGroup.allthings_group"))
                        .icon(() -> new ItemStack(ModItems.DREAM_FRAGMENT))
                        .entries((displayContext, entries) -> {
                            entries.add(ModItems.DREAM_FRAGMENT);
                            entries.add(ModItems.SECRET_SHADOW_DUST);
                            entries.add(ModItems.MYSTERIOUS_BOOK);
                            entries.add(ModBlocks.EFFECT_UPGRADE);
                        }).build());
    }
}
